package best.driver.android;

import android.content.Intent;
import android.os.Bundle;
import best.driver.android.Activity.Base.BaseActivity;
import best.driver.android.Activity.Login.Login;
import best.driver.android.Activity.Order.WorkActivity;
import best.driver.android.Activity.Register.CheckHintActivity;
import best.driver.android.manager.UserInfoManager;

public class HomeActivity extends BaseActivity {
    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        if(!UserInfoManager.getInstance().isLogin()) {
            startActivity(new Intent(HomeActivity.this, Login.class));
            finish();
        } else if(!UserInfoManager.getInstance().isCheckSucceed()){
            startActivity(new Intent(HomeActivity.this, CheckHintActivity.class));
            finish();
        } else {
            startActivity(new Intent(HomeActivity.this, WorkActivity.class));
            finish();
        }
    }
}
